<?php

class cache extends zhuayi
{
	
	function __construct($fields = array())
	{
		extract($fields, EXTR_OVERWRITE);
		
		$this->cache = new Memcache;
		$this->cache->connect($hosts,$port);

	}
	
	/**
	 * 读取缓存 
	 *
	 */
	function get($key)
	{
		return  $this->cache->get($key);
		return strings::json_dearray($reset);
	}
	
	/**
	 * 写入缓存 
	 *
	 */
	function set($time,$key,$val)
	{
		//$val = strings::json_enarray($val);
		
		$this->cache->set($key,$val, 0, $time);
	}

}

?>